﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tron.Players;
using System.Collections.ObjectModel;

namespace Tron.DataStructures
{
    class Percepts
    {
        public IBoardStatePercepts Board { get; private set; }

        List<IPlayerStatePercepts> playerStates;
        ReadOnlyCollection<IPlayerStatePercepts> readOnlyPlayerStates;

        /// <summary>
        /// Note: A player can index into this collection using his PlayerIndex to retrieve his own state.
        /// </summary>
        public ReadOnlyCollection<IPlayerStatePercepts> PlayerStates
        {
            get
            {
                return readOnlyPlayerStates;
            }
        }

        public Percepts(Board board, List<IPlayerStatePercepts> playerStates)
        {
            this.Board = (IBoardStatePercepts)board;
            this.playerStates = playerStates;
            readOnlyPlayerStates = new ReadOnlyCollection<IPlayerStatePercepts>(playerStates);
        }
    }
}
